namespace ActiveRecordSample.Entities
{
	// Business class SalesOrderDetail generated from SalesOrderDetail
	// shvadskd [2008-10-20] Created

	using System;
	using System.ComponentModel;
	using Castle.ActiveRecord;

   [ActiveRecord("SalesLT.SalesOrderDetail")]
	public  class SalesOrderDetail 
		: ActiveRecordValidationBase<SalesOrderDetail> 
	{

		#region Property_Names

		public static string Prop_SalesOrder = "SalesOrder";
		public static string Prop_SalesOrderDetailID = "SalesOrderDetailID";
		public static string Prop_OrderQty = "OrderQty";
		public static string Prop_Product = "Product";
		public static string Prop_UnitPrice = "UnitPrice";
		public static string Prop_UnitPriceDiscount = "UnitPriceDiscount";
		public static string Prop_LineTotal = "LineTotal";
		public static string Prop_rowguid = "rowguid";
		public static string Prop_ModifiedDate = "ModifiedDate";

		#endregion

		#region Private_Variables

		private SalesOrderHeader _salesorderid;
		private int _salesorderdetailid;
		private short _orderQty;
		private Product _product;
		private System.Decimal _unitPrice;
		private System.Decimal _unitPriceDiscount;
		private System.Decimal _lineTotal;
		private byte[] _rowguid;
		private DateTime _modifiedDate;


		#endregion

		#region Constructors

		public SalesOrderDetail()
		{
		}

		public SalesOrderDetail(
			SalesOrderHeader p_salesorderid,
			int p_salesorderdetailid,
			short p_orderQty,
			Product p_product,
			System.Decimal p_unitPrice,
			System.Decimal p_unitPriceDiscount,
			System.Decimal p_lineTotal,
			byte[] p_rowguid,
			DateTime p_modifiedDate)
		{
			_salesorderid = p_salesorderid;
			_salesorderdetailid = p_salesorderdetailid;
			_orderQty = p_orderQty;
			_product = p_product;
			_unitPrice = p_unitPrice;
			_unitPriceDiscount = p_unitPriceDiscount;
			_lineTotal = p_lineTotal;
			_rowguid = p_rowguid;
			_modifiedDate = p_modifiedDate;
		}

		#endregion

		#region Properties

		[PrimaryKey("SalesOrderID", Access = PropertyAccess.NosetterLowercaseUnderscore)]
		public SalesOrderHeader SalesOrder
		{
			get { return _salesorderid; }
		}

		[PrimaryKey("SalesOrderDetailID", Access = PropertyAccess.NosetterLowercaseUnderscore)]
		public int SalesOrderDetailID
		{
			get { return _salesorderdetailid; }
		}

		[Property("OrderQty", NotNull = true)]
		public short OrderQty
		{
			get { return _orderQty; }
			set { _orderQty = value; }
		}

		[BelongsTo("ProductID", Type = typeof(Product))]
		public Product Product
		{
			get { return _product; }
			set { _product = value; }
		}

		[Property("UnitPrice", NotNull = true)]
		public System.Decimal UnitPrice
		{
			get { return _unitPrice; }
			set { _unitPrice = value; }
		}

		[Property("UnitPriceDiscount", NotNull = true)]
		public System.Decimal UnitPriceDiscount
		{
			get { return _unitPriceDiscount; }
			set { _unitPriceDiscount = value; }
		}

		[Property("LineTotal", NotNull = true)]
		public System.Decimal LineTotal
		{
			get { return _lineTotal; }
			set { _lineTotal = value; }
		}    

		[Property("ModifiedDate", NotNull = true)]
		public DateTime ModifiedDate
		{
			get { return _modifiedDate; }
			set { _modifiedDate = value; }
		}

		#endregion

	} // SalesOrderDetail
}

